<!--
 * @Descripttion: 
 * @version: 
 * @Author: ruxiang.wang
 * @Date: 2021-06-04 17:06:37
 * @LastEditors: ruxiang.wang
 * @LastEditTime: 2021-07-09 11:13:58
-->
<template>
  <div class="app-container">
    <el-form :model="ruleForm1" :rules="rules1" ref="ruleForm" label-width="100px" class="demo-ruleForm">
      <el-form-item label="功能名称" prop="name">
        <el-input v-model="ruleForm1.name"></el-input>
      </el-form-item>
      <el-form-item label="封面图片" prop="region">
        
      </el-form-item>
      <el-form-item label="主题" prop="title">
        <!-- 富文本编辑器 -->
        <div class="app-container">
          <editor :curValue="content" @input="newContent" />
        </div>
      </el-form-item>
    </el-form>
    <div class="footer-btn">
      <el-button>取 消</el-button>
      <el-button type="primary">保 存</el-button>
    </div>
  </div>
</template>

<script>
//引入富文本编辑器组件
import Tinymce from '@/components/tinymce/index'

export default {
  components: {
    'editor': Tinymce
  },

  data() {
    return {
      // 富文本编辑器内容
      content:'',
      // 功能配置（新增/编辑）第二层弹窗
      ruleForm1: {
        name: '',
        region: '',
        model: ''
      },
      rules1: {
        name: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
          { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
        ],
        region: [
          { required: true, message: '请选择部署国家', trigger: 'change' }
        ],
        model: [
          { required: true, message: '请选择生效机型', trigger: 'change' }
        ],
      },
    }
  },
  watch: {
    
  },

  methods: {
    // 富文本编辑器
    newContent(val) {
      console.log(val); //获取输入内容
      // debugger
    },
  }
}
</script>

<style lang="scss" scoped>
  .footer-btn{
    text-align: right;
  }
</style>

